﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anagramme.Contracts.Tests
{
    [TestClass]
    public class WordInfoTests
    {
        [TestMethod]
        public void SetIsFoundRaisePropertyChanged()
        {
            string actual = string.Empty;
            string expected = "IsFound";

            WordInfo word = new WordInfo();
            word.PropertyChanged += (s, e) => actual = e.PropertyName;
            word.IsFound = true;

            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void SetValueFoundRaisePropertyChanged()
        {
            string actual = string.Empty;
            string expected = "Value";

            WordInfo word = new WordInfo();
            word.PropertyChanged += (s, e) => actual = e.PropertyName;
            word.Value = "test";

            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void InstanciateWithWordAffectWord()
        {
            string expected = "test";

            WordInfo word = new WordInfo(expected);
            string actual = word.Value;

            Assert.AreEqual(false, word.IsFound);
            Assert.AreEqual(expected, actual);
        }
    }
}
